/*******************************************************************************
 * Copyright (c) SCUT. 2022. All rights reserved.
 * Description: The realization of ilaenv.
 * Author: CHEN Han
 * Create: 2022-06-26
 *******************************************************************************/

int ilaenv(const int* ispec,

           const char* name,

           const char* opts,

           const int* n1,

           const int* n2,

           const int* n3,

           const int* n4)
           {
    const int n = *n1;

    if (n <= 0) {
        return 0;

    } else if (n <= 1000) {
        return 4;

    } else if (n <= 2000) {
        return 16;

    } else if (n <= 4000) {
        return 64;

    } else if (n <= 10000) {
        return 128;

    } else if (n <= 20000) {
        return 256;

    } else {
        return 512;
    }
            }